<template>
	<view class="container">
		<uv-sticky>
			<uv-tabs :list="list" :scrollable="false" @change="change"></uv-tabs>
		</uv-sticky>
		<view v-show="current == 0">
			<bound ref="bound"></bound>
		</view>
		<view v-show="current == 1">
			<Untied ref="Untied"></Untied>
		</view>
	</view>

</template>

<script>
	import bound from './bound/index.vue'
	import Untied from './Untied/index.vue'
	export default {
		components: {
			bound,
			Untied,
		},
		data() {
			return {
				list: [{
					name: '已绑定终端列表'
				}, {
					name: '已解绑终端列表'
				}],
				current: 0,
			}
		},
		onLoad(e) {

		},
		onShow() {
			if (this.current === 0) {
				this.$refs.bound.onShow1();
			} else if (this.current === 1) {
				this.$refs.Untied.onShow1();
			}
		},
		onPullDownRefresh() {
			if (this.current === 0) {
				this.$refs.bound.onPullDownRefresh1();
			} else if (this.current === 1) {
				this.$refs.Untied.onPullDownRefresh1();
			}
			uni.stopPullDownRefresh(); //停止刷新
		},
		onReachBottom() {
			if (this.current === 0) {
				this.$refs.bound.onReachBottom1();
			} else if (this.current === 1) {
				this.$refs.Untied.onReachBottom1();
			}
		},
		methods: {
			change(item) {
				this.current = item.index;
			},
		},
		onShareAppMessage(e) {
			return {
				title: '飞鑫付',
				path: '/pages/index/index'
			}
		},

	}
</script>

<style>
	.uv-tabs {
		background-color: #ffffff;
	}
</style>
<style lang="scss" scoped>
	.container {
		height: 100vh;
		background: #f4f4f4;

	}

	.nav-title {
		color: #031A6E
	}

	/deep/.uv-tabs__wrapper__nav__item {
		width: 29%;
	}
</style>